package licode.unisop.realm.domainx.dp;

import org.springframework.util.Assert;

public class Name {
    public static final Name EMPTY = new Name("");
    private final String name;

    public Name(String name) {
        Assert.notNull(name, "名字为空：" + name);
        Assert.isTrue(name.length() < 20,
                "名字太长（小于20字符）：" + name);
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public boolean equals(Name Other) {
        return this.name.equals(Other.getName());
    }
}
